# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=xf86-video-intel
pkgver=2.99.917_git20191210
_pkgver=f66d39544bb8339130c96d282a80f87ca1606caf
pkgrel=0
pkgdesc="X.Org driver for Intel cards"
url="https://xorg.freedesktop.org"
arch="x86 x86_64"
license="MIT"
subpackages="$pkgname-doc"
depends="mesa-dri-intel"
makedepends="xorg-server-dev libxi-dev libdrm-dev mesa-dev libxvmc-dev
	xcb-util-dev eudev-dev util-macros autoconf automake libtool xorgproto
	libxv-dev"
source="https://github.com/freedesktop/xorg-xf86-video-intel/archive/$_pkgver.zip"

builddir="$srcdir/xorg-xf86-video-intel-$_pkgver"
prepare() {
	default_prepare
	autoreconf -vif
}

build() {
	export LDFLAGS="$LDFLAGS -Wl,-z,lazy"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--enable-xvmc \
		--disable-selective-werror \
		--with-default-dri=3
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
	install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING

	# http://bugs.alpinelinux.org/issues/3312
	chmod o-x "$pkgdir"/usr/libexec/xf86-video-intel-backlight-helper
}
sha512sums="3d2448e4ac5c7732882ea1e405b5cdf905fe8f2730a0f645d34fac43487cdf3d82f72bcb9bf3d25aa78ab6ee9d130b08d163c22e593872c722512fb8a55d5f26  f66d39544bb8339130c96d282a80f87ca1606caf.zip"
